package rn;

import java.text.ParseException;
import javax.swing.text.MaskFormatter;

/**
 *
 * @author roberta.m.carvalho
 */
public class FormataString {

    public static String formatarCpf(String cpf, String mascara) throws ParseException {
        MaskFormatter mf = new MaskFormatter(mascara);
        mf.setValueContainsLiteralCharacters(false);
        return mf.valueToString(cpf);
    }
}
